home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
-
- //-
- // ==========================================================================
- // Copyright (C) Alias|Wavefront, a division of Silicon Graphics Limited.
- // All rights reserved. These coded instructions, statements and computer
- // programs contain unpublished information proprietary to Alias|Wavefront,
- // a division of Silicon Graphics Limited, which is protected by the
- // Canadian and US federal copyright law and may not be disclosed to third
- // parties or copied or duplicated, in whole or in part, without prior
- // written consent of Alias|Wavefront, a division of Silicon Graphics Limited
- // ==========================================================================
- //+//
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 6 June 1997
- //
- // Create a new model panel with the menu bar
- //
-
- global int $supportHWshadows;
-
- global proc enableIsolateSelect (string $editor, int $enable)
- {
- if ($enable) {
- // First, find out what is connected to this editor
- //
- string $mainListConnection = `editor -query -mainListConnection $editor`;
- if ($mainListConnection == "") {
- if ( `menuItem -q -checkBox autoLoadItem` ) {
- editor -edit -mainListConnection "activeList" $editor;
- }
- else {
- editor -edit -lck -mainListConnection "activeList" $editor;
- }
- }
- else if (`selectionConnection -query -lock $mainListConnection`) {
- editor -edit -ulk $editor;
- editor -edit -lck $editor;
- }
- }
- modelEditor -edit -viewSelected $enable $editor;
- }
-
- global proc removeSelectedFromEditor (string $editor)
- {
- // Make sure the editor exists
- //
- if (!`editor -exists $editor`) {
- error "Editor not found";
- }
- // If this is a modelEditor, then we can add the members directly
- //
- if (`modelEditor -exists $editor`) {
- modelEditor -edit -removeSelected $editor;
- return;
- }
- }
-
- global proc updateIsolateMenu( string $parentMenu, string $editor, string $panel )
- //
- // This updates the shading menu, based on the current settings
- // of the model editor
- //
- {
- loadAnimMenuLibrary;
-
- // Set the proper check state of the AutoLoad menu
- //
- setParent -menu $parentMenu;
-
- if (`menu -query -numberOfItems $parentMenu` == 0) {
- // Register the default connection for this editor
- //
- registerEditor $editor "activeList";
-
- menuItem -label "View Selected" -enableCommandRepeat false
- -checkBox true
- -command ("enableIsolateSelect " + $editor + " #1")
- iselectEnableItem;
- menuItem -label "Auto Load New Objects"
- -checkBox false
- -command ("isoSelectAutoAddNewObjs " + $panel + " #1")
- autoLoadNewItem;
- menuItem -label "Auto Load Selected Objects"
- -checkBox false
- -command ("toggleAutoLoad " + $editor + " #1")
- autoLoadItem;
- menuItem -label "Load Selected Objects"
- -command ("doReload " + $editor)
- reloadItem;
- menuItem -label "Add Selected Objects"
- -command ("addSelectedToEditor " + $editor)
- addToListItem;
- menuItem -label "Remove Selected Objects"
- -command ("removeSelectedFromEditor " + $editor)
- removeFromListItem;
-
- string $menuItem = `menuItem -label "Bookmarks"
- -subMenu true -aob true
- bookMarkHierItem`;
- menuItem -edit
- -postMenuCommand ("buildBookmarkMenu -type bookmarkModelView -editor " + $editor + " " + $menuItem)
- $menuItem;
- menuItem
- -label "Bookmark Current Objects"
- -command ("createBookmark " + $editor + " bookmarkModelView false")
- bookAnimMarkObjectsItem;
- menuItem -optionBox true
- -label "Bookmark Current Objects Option Box"
- -command ("createBookmark " + $editor + " bookmarkModelView true")
- bookAnimMarkObjectsDialog;
- menuItem -divider true;
- setParent -menu ..;
- }
-
- menuItem -e -checkBox `modelEditor -q -viewSelected $editor` iselectEnableItem;
-
- // First, find out what is connected to this editor
- //
- string $mainListConnection = `editor -query -mainListConnection $editor`;
-
- // If it is NOT the active list, then check it off
- //
- if($mainListConnection != "activeList") {
- menuItem -edit -checkBox off autoLoadItem;
- menuItem -edit -enable true reloadItem;
- menuItem -edit -enable true addToListItem;
- }
- else if (`selectionConnection -query -lock $mainListConnection`) {
- menuItem -edit -checkBox off autoLoadItem;
- menuItem -edit -enable true reloadItem;
- menuItem -edit -enable true addToListItem;
- }
- else {
- menuItem -edit -checkBox on autoLoadItem;
- menuItem -edit -enable false reloadItem;
- menuItem -edit -enable false addToListItem;
- }
- }
-
- global proc createModelPanelMenu( string $panel )
- {
- int $dimWhenNoSelect = 0;
-
- // if this menu has already been built, return
- //
- {
- string $panelControl = `panel -q -control $panel`;
- if ( `menuBarLayout -exists $panelControl` ){
- string $ma[] = `menuBarLayout -q -menuArray $panelControl`;
- for ( $name in $ma ){
- if ( $name == "View" ){
- return;
- }
- }
- setParent $panelControl;
- }
- }
-
- // By the time we get here, we know the menu bar
- // of the modelPanel is the current menu bar
- //
- // Get the name of the model editor in this panel
- //
- string $ed = `modelPanel -q -modelEditor $panel`;
-
- string $itemName;
-
-
- // The shadows menu item will only be available
- // if the hardware support the HWshadows
- //
- global int $supportHWshadows;
- string $checkHWshadowsExt = `openGLExtension -ext "GL_SGIX_shadow"`;
- if( $checkHWshadowsExt == "" )
- {
- $checkHWshadowsExt = `openGLExtension -ext "GL_EXT_texture_env_combine"`;
- if( $checkHWshadowsExt != "" ) {
- $checkHWshadowsExt = `openGLExtension -ext "GL_ARB_multitexture"`;
- if( $checkHWshadowsExt != "" ) {
- $checkHWshadowsExt = `openGLExtension -ext "GL_EXT_bgra"`;
- }
- }
- }
- if( $checkHWshadowsExt == "" ) { $supportHWshadows = false; }
- else { $supportHWshadows = true; }
-
- menu -tearOff true
- -l "View"
- -familyImage "menuIconView.xpm"
- -postMenuCommand ("setFocus "+$ed)
- View;
-
- menuItem -label "Select Camera"
- -command ("{ string $camera = `modelPanel -q -camera "+$panel+"`; "+
- "eval select `getCameraNode view $camera` `getCameraNode up $camera` $camera; }");
-
- menuItem -divider true;
-
- menuItem -label "Previous View"
- -command ("UndoViewChange");
- menuItem -label "Next View"
- -command ("RedoViewChange");
- menuItem -label "Default Home"
- -command ("{ string $camera = `modelEditor -q -camera "+$ed+"`;"+
- "viewSet -home $camera;}");
-
- menuItem -d true;
-
- $itemName = `menuItem -label "Look at Selection"
- -command ("{ string $camera = `modelEditor -q -camera "+$ed+"`;"+
- "viewLookAt $camera;}")`;
- if ($dimWhenNoSelect)
- dimWhen -false SomethingSelected $itemName;
-
- menuItem -label "Frame All" -command ("FrameAll");
-
- $itemName = `menuItem -label "Frame Selection"
- -command ("FrameSelected")`;
- if ($dimWhenNoSelect)
- dimWhen -false SomethingSelected $itemName;
-
- menuItem -divider true;
-
- menuItem -label "Predefined Bookmarks" -subMenu true -tearOff true;
- menuItem -label "Perspective"
- -command ("viewSet -p `modelEditor -q -camera "+$ed+"`;");
- menuItem -label "Front"
- -command ("viewSet -f `modelEditor -q -camera "+$ed+"`;");
- menuItem -label "Top"
- -command ("viewSet -t `modelEditor -q -camera "+$ed+"`;");
- menuItem -label "Right Side"
- -command ("viewSet -rs `modelEditor -q -camera "+$ed+"`;");
- menuItem -label "Left Side"
- -command ("viewSet -ls `modelEditor -q -camera "+$ed+"`;");
- menuItem -label "Back"
- -command ("viewSet -b `modelEditor -q -camera "+$ed+"`;");
- menuItem -label "Bottom"
- -command ("viewSet -bo `modelEditor -q -camera "+$ed+"`;");
- setParent -m ..;
- $itemName = `menuItem -label "Bookmarks" -subMenu true`;
- menuItem -e -postMenuCommand
- ("buildCameraBookmarkMenu "+$itemName+" "+$panel) $itemName;
- setParent -m ..;
-
- menuItem -divider true;
-
- $itemName = `menuItem -label "Camera Settings" -subMenu true -tearOff true`;
- menuItem -e -postMenuCommand
- ("buildCameraToggleMenu "+$itemName+" "+$panel) $itemName;
- setParent -m ..;
-
- menuItem -label "Camera Attribute Editor..."
- -command ("showPanelCameraEditor "+$panel);
-
- menuItem -label "Camera Tools" -subMenu true -tearOff true -aob true camerCtrlItem;
-
- menuItem
- -label "Tumble Tool"
- -annotation (getRunTimeCommandAnnotation("TumbleTool"))
- -image "tumble.xpm"
- -command ("TumbleTool");
-
- menuItem
- -optionBox true
- -command ("TumbleTool; ToolSettingsWindow");
-
- menuItem
- -label "Track Tool"
- -annotation (getRunTimeCommandAnnotation("TrackTool"))
- -image "track.xpm"
- -command ("TrackTool");
-
- menuItem
- -optionBox true
- -command ("TrackTool; ToolSettingsWindow");
-
- menuItem
- -label "Dolly Tool"
- -annotation (getRunTimeCommandAnnotation("DollyTool"))
- -image "dolly.xpm"
- -command ("DollyTool");
-
- menuItem
- -optionBox true
- -command ("DollyTool; ToolSettingsWindow");
-
- menuItem
- -label "Zoom Tool"
- -annotation (getRunTimeCommandAnnotation("ZoomTool"))
- -image "boxZoom.xpm"
- -command ("ZoomTool");
-
- menuItem
- -optionBox true
- -command ("ZoomTool; ToolSettingsWindow");
-
- menuItem -divider true;
-
- menuItem -label "Roll Tool"
- -annotation "Roll Tool: Roll the camera"
- -image "roll.xpm"
- -command "setToolTo rollContext";
-
- menuItem -optionBox true
- -command "setToolTo rollContext; toolPropertyWindow";
-
- menuItem -label "Azimuth Elevation Tool"
- -annotation "Azimuth Elevation Tool: Change the Azimuth Elevation"
- -image "azimuthElevation.xpm"
- -command "setToolTo azimuthElevationContext";
-
- menuItem -optionBox true
- -command "setToolTo azimuthElevationContext; toolPropertyWindow";
-
- menuItem -label "Yaw-Pitch Tool"
- -annotation "Yaw-Pitch Tool: Change the camera Yaw and Pitch"
- -image "yawPitch.xpm"
- -command "setToolTo yawPitchContext";
-
- menuItem -optionBox true
- -command "setToolTo yawPitchContext; toolPropertyWindow";
-
- menuItem -label "Fly Tool"
- -annotation "Fly Tool: Change the camera direction and position"
- -command "setToolTo flyThroughContext";
-
- setParent -menu ..;
-
- menuItem -divider true;
-
- string $imagePlaneMenuName = $ed + "imagePlaneSubMenu";
-
- menuItem -label "Image Plane" -subMenu true -tearOff true
- $imagePlaneMenuName;
-
- menuItem -e -postMenuCommand
- ("buildImagePlaneMenu " + $imagePlaneMenuName + " " + $panel)
- $imagePlaneMenuName;
-
- setParent -m ..;
-
-
- setParent -m ..;
-
- $itemName = `menu -tearOff true
- -aob true
- -l "Shading"
- -postMenuCommandOnce false
- -familyImage "menuIconShading.xpm"`;
- menu -edit -pmc ("updateShadingMenu "+$itemName+" "+$ed) $itemName;
-
- radioMenuItemCollection;
- menuItem -radioButton true -label "Wireframe"
- -command ("DisplayWireframe")
- shadeWireItem;
- menuItem -radioButton false -label "Smooth Shade All"
- -command ("modelEditor -edit -displayAppearance smoothShaded -activeOnly false " + $ed)
- shadeSmoothItem;
- menuItem -radioButton false -label "Smooth Shade Selected Items"
- -command ("modelEditor -edit -displayAppearance smoothShaded -activeOnly true " + $ed)
- shadeSmoothSelectedItem;
- menuItem -radioButton false -label "Flat Shade All"
- -command ("modelEditor -edit -displayAppearance flatShaded -activeOnly false " + $ed)
- shadeFlatItem;
- menuItem -radioButton false -label "Flat Shade Selected Items"
- -command ("modelEditor -edit -displayAppearance flatShaded -activeOnly true " + $ed)
- shadeFlatSelectedItem;
- menuItem -radioButton false -label "Bounding Box"
- -command ("modelEditor -edit -displayAppearance boundingBox " + $ed)
- shadeBBoxItem;
- menuItem -radioButton false -label "Points"
- -command ("modelEditor -edit -displayAppearance points " + $ed)
- shadePointsItem;
-
- menuItem -divider true;
-
- menuItem -sm true -l "Shade Options" shadeOptionItem;
- menuItem -checkBox 1 -l "Wireframe on Shaded"
- -command ("modelEditor -e -wos #1 "+$ed)
- wireOnShadedItem;
-
- menuItem -checkBox false -l "X-Ray"
- -command ("modelEditor -e -xray #1 "+$ed)
- xrayItem;
-
- menuItem -checkBox false -l "Transparency Sorting"
- -command ("modelEditor -e -st #1 "+$ed)
- transpSortItem;
-
- setParent -m ..;
-
- menuItem -sm true -l "Interactive Shading" interactiveShadingItem;
- radioMenuItemCollection;
- menuItem -radioButton true -l "Normal"
- -command ("modelEditor -e -useInteractiveMode off "+$ed)
- useInteractiveItem;
- menuItem -radioButton false -l "Wireframe"
- -command ("modelEditor -e -interactive -useInteractiveMode on " +
- "-da wireframe "+$ed)
- interactiveShadeWireItem;
- menuItem -radioButton false -l "Bounding Box"
- -command ("modelEditor -e -interactive -useInteractiveMode on " +
- "-da boundingBox "+$ed)
- interactiveShadeBBoxItem;
- menuItem -radioButton false -l "Points"
- -command ("modelEditor -e -interactive -useInteractiveMode on " +
- "-da points "+$ed)
- interactiveShadePointsItem;
- setParent -m ..;
- menuItem -d true;
-
-
- if (`about -nt` || `about -mac`)
- {
- menuItem -checkBox true -l "Dense Wireframe Acceleration"
- -command ("modelEditor -e -wbs #1 "+$ed)
- backingStoreItem;
- }
- else
- {
- menuItem -checkBox true -l "Color Index Mode"
- -command ("modelEditor -e -useColorIndex #1 "+$ed)
- colorIndexItem;
- }
- menuItem -checkBox false -label "Backface Culling"
- -command ("ToggleBackfaceCulling")
- -annotation (getRunTimeCommandAnnotation("ToggleBackfaceCulling"))
- backFaceCullingItem;
-
- menuItem -checkBox false -l "Smooth Wireframe"
- -command ("modelEditor -e -smoothWireframe #1 "+$ed)
- smoothWireframeItem;
-
- if (`about -irix`)
- {
- menuItem -edit -enable false smoothWireframeItem;
- }
-
- menuItem -d true;
- menuItem -checkBox false
- -l "Hardware Texturing"
- -command ("modelEditor -e -displayTextures #1 "+$ed)
- dispTexItem;
- menuItem -enableCommandRepeat false -optionBox 1
- -l "Hardware Texturing Option Box"
- -command ("hwTxOptions 1 "+$ed) dispTexOptionItem;
-
- menuItem -checkBox false
- -l "Hardware Fog"
- -command ("modelEditor -e -fogging #1 "+$ed)
- dispFogItem;
- menuItem -enableCommandRepeat false -optionBox 1
- -l "Hardware Fog Option Box"
- -command ("hwFogOptions 1 "+$ed) dispFogOptionItem;
-
- menuItem -divider true;
-
- menuItem -label "Apply Current to All"
- -command ( "updateAllModelEditorsToShadingSetting( \"" + $itemName
- + "\", \"" + $ed + "\")" )
- updateAllViewsItem;
-
- $itemName = `menu -tearOff true
- -l "Lighting"
- -postMenuCommandOnce false
- -familyImage "menuIconLighting.xpm"`;
- menu -e -pmc ("updateLightingMenu "+$itemName+" "+$ed) $itemName;
- radioMenuItemCollection;
- menuItem -radioButton true -l "Use Default Lighting"
- -command ("modelEditor -e -dl \"default\" "+$ed)
- lightDefaultItem;
- menuItem -radioButton false -l "Use All Lights"
- -command ("DisplayLight")
- lightAllItem;
- menuItem -radioButton false -l "Use Selected Lights"
- -command ("modelEditor -e -dl active "+$ed)
- lightActiveItem;
- menuItem -radioButton false -l "Use No Lights"
- -command ("modelEditor -e -dl none "+$ed)
- lightNoneItem;
- menuItem -radioButton false -enable false -l "Use Previously Specified Lights "
- lightPreviousItem;
- menuItem -divider true;
- menuItem -checkBox false -enable true -l "Two Sided Lighting"
- -command ("modelEditor -e -twoSidedLighting #1 "+$ed)
- lightTwoSidedItem;
- menuItem -checkBox false -enable $supportHWshadows -l "Shadows"
- -command ("modelEditor -e -shadows #1 "+$ed)
- lightHardwareShadows;
- menuItem -divider true;
- $itemName = `menuItem -label "Specify Selected Lights"
- -command ("modelEditor -e -dl selected "+$ed)
- lightSelectedItem`;
- if ($dimWhenNoSelect)
- dimWhen -false SomethingSelected $itemName;
-
- $itemName = `menu -tearOff true
- -l "Show"
- -postMenuCommandOnce false
- -familyImage "menuIconShow.xpm"`;
- menu -e -pmc ("updateShowMenu "+$itemName+" "+$ed) $itemName;
-
-
- $itemName = `menuItem -label "Isolate Select" -subMenu true -tearOff true`;
- menuItem -e -pmc ("updateIsolateMenu "+$itemName+" "+$ed+" "+$panel) $itemName;
- setParent -m ..;
-
- menuItem -divider true;
-
- menuItem -label "All" -enableCommandRepeat false
- -command ("modelEditor -e -allObjects 1 " + $ed + ";updateShowMenu "+$itemName+" "+$ed)
- showAllItem;
- menuItem -label "None" -enableCommandRepeat false
- -command ("modelEditor -e -allObjects 0 " + $ed + ";updateShowMenu "+$itemName+" "+$ed)
- showNoneItem;
-
- menuItem -divider true;
-
- menuItem -label "NURBS Curves" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -nurbsCurves #1 " + $ed)
- showNurbsCurvesItem;
- menuItem -label "NURBS Surfaces" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -nurbsSurfaces #1 " + $ed)
- showNurbsSurfacesItem;
- menuItem -label "Polygons" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -polymeshes #1 " + $ed)
- showPolymeshesItem;
- menuItem -label "Subdiv Surfaces" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -subdivSurfaces #1 " + $ed)
- showSubdivSurfacesItem;
- menuItem -label "Planes" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -planes #1 " + $ed)
- showPlanesItem;
- menuItem -label "Lights" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -lights #1 " + $ed)
- showLightsItem;
- menuItem -label "Cameras" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -cameras #1 " + $ed)
- showCamerasItem;
- menuItem -label "Joints" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -joints #1 " + $ed)
- showJointsItem;
- menuItem -label "IK Handles" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -ikHandles #1 " + $ed)
- showIkHandlesItem;
- menuItem -label "Deformers" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -deformers #1 " + $ed)
- showDeformersItem;
- menuItem -label "Dynamics" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -dynamics #1 " + $ed)
- showDynamicsItem;
- if( fluidEditLicenseFound() ) {
- menuItem -label "Fluids" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -fluids #1 " + $ed)
- showFluidsItem;
- }
- menuItem -label "Locators" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -locators #1 " + $ed)
- showLocatorsItem;
- menuItem -label "Dimensions" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -dimensions #1 " + $ed)
- showDimensionsItem;
- menuItem -label "Pivots" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -pivots #1 " + $ed)
- showPivotsItem;
- menuItem -label "Handles" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -handles #1 " + $ed)
- showHandlesItem;
- menuItem -label "Textures" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -textures #1 " + $ed)
- showTexturesItem;
- if (`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- menuItem -label "Strokes" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -strokes #1 " + $ed)
- showStrokesItem;
- }
-
- menuItem -divider true;
-
- menuItem -label "NURBS CVs" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -cv #1 " + $ed)
- showNurbsCVsItem;
- menuItem -label "NURBS Hulls" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -hulls #1 " + $ed)
- showNurbsHullsItem;
- menuItem -label "Grid" -checkBox 1 -enableCommandRepeat false
- -command ("modelEditor -e -grid #1 " + $ed)
- showGridItem;
-
-
- buildPanelPopupMenu( $panel );
-
- }
-
- global proc updateAllModelEditorsToShadingSetting( string $menu, string $ed )
- //
- // Update all model editors to have the same settings as this one
- //
- //
- {
- string $shadeMode = `modelEditor -q -displayAppearance $ed`;
- string $interactiveShadeMode =
- `modelEditor -q -interactive -displayAppearance $ed`;
- int $xray = `modelEditor -q -xray $ed`;
- int $transpSort = `modelEditor -q -st $ed`;
- int $useInteractiveMode = `modelEditor -q -useInteractiveMode $ed`;
- int $activeOnly = `modelEditor -q -activeOnly $ed`;
- int $useColorIndex = `modelEditor -q -useColorIndex $ed`;
- int $culling = `modelEditor -q -backfaceCulling $ed`;
- int $wireOnShaded = `modelEditor -q -wireframeOnShaded $ed`;
- int $textures = `modelEditor -q -displayTextures $ed`;
- int $fogging = `modelEditor -q -fogging $ed`;
- int $backingStore = `modelEditor -q -wbs $ed`;
- int $smoothWireframe = `modelEditor -q -smoothWireframe $ed`;
-
- string $editors[] = `getPanel -type "modelPanel"`;
-
- for ( $editor in $editors ) {
- modelEditor -edit
- -displayAppearance $shadeMode
- -xray $xray
- -st $transpSort
- -useInteractiveMode $useInteractiveMode
- -activeOnly $activeOnly
- -useColorIndex $useColorIndex
- -wbs $backingStore
- -backfaceCulling $culling
- -wireframeOnShaded $wireOnShaded
- -fogging $fogging
- -displayTextures $textures
- -smoothWireframe $smoothWireframe
- $editor;
- modelEditor -edit -interactive
- -displayAppearance $interactiveShadeMode
- $editor;
- }
- }
-
- global proc updateShadingMenu( string $menu, string $ed )
- //
- // This updates the shading menu, based on the current settings
- // of the model editor
- //
- {
- setParent -m $menu;
- string $shadeMode = `modelEditor -q -displayAppearance $ed`;
- string $interactiveShadeMode =
- `modelEditor -q -interactive -displayAppearance $ed`;
- int $xray = `modelEditor -q -xray $ed`;
- int $transpSort = `modelEditor -q -st $ed`;
- int $useInteractiveMode = `modelEditor -q -useInteractiveMode $ed`;
- int $activeOnly = `modelEditor -q -activeOnly $ed`;
- int $culling = `modelEditor -q -backfaceCulling $ed`;
- int $fogging = `modelEditor -q -fogging $ed`;
- int $textures = `modelEditor -q -displayTextures $ed`;
- int $colorIndex = `modelEditor -q -useColorIndex $ed`;
- int $backingStore = `modelEditor -q -wbs $ed`;
- int $smoothWireframe = `modelEditor -q -smoothWireframe $ed`;
- int $modeIsShaded = false;
-
- menuItem -e -checkBox `modelEditor -q -wos $ed` wireOnShadedItem;
-
- // Set the radio buttons to reflect which display
- // style is selected
- //
- switch($shadeMode){
- case "wireframe":
- menuItem -e -radioButton true shadeWireItem;
- menuItem -e -enable true shadeOptionItem;
- break;
- case "points":
- menuItem -e -radioButton true shadePointsItem;
- menuItem -e -enable false shadeOptionItem;
- break;
- case "boundingBox":
- menuItem -e -radioButton true shadeBBoxItem;
- menuItem -e -enable false shadeOptionItem;
- break;
- case "smoothShaded":
- $modeIsShaded = true;
- if ( $activeOnly ){
- menuItem -e -radioButton true shadeSmoothSelectedItem;
- } else {
- menuItem -e -radioButton true shadeSmoothItem;
- }
- menuItem -e -enable true shadeOptionItem;
- break;
- case "flatShaded":
- $modeIsShaded = true;
- if ( $activeOnly ){
- menuItem -e -radioButton true shadeFlatSelectedItem;
- } else {
- menuItem -e -radioButton true shadeFlatItem;
- }
- menuItem -e -enable true shadeOptionItem;
- break;
- default:
- menuItem -e -enable true shadeOptionItem;
- break;
- }
-
- menuItem -e -checkBox $xray xrayItem;
- menuItem -e -checkBox $transpSort transpSortItem;
- menuItem -e -checkBox $textures dispTexItem;
- menuItem -e -checkBox $fogging dispFogItem;
- menuItem -e -checkBox $culling backFaceCullingItem;
- menuItem -e -checkBox $smoothWireframe smoothWireframeItem;
-
- if (`menuItem -exists colorIndexItem`)
- {
- menuItem -e -checkBox $colorIndex colorIndexItem;
- }
- if (`menuItem -exists backingStoreItem`)
- {
- menuItem -e -checkBox $backingStore backingStoreItem;
- }
-
- // Set the radio buttons to reflect which interactive
- // mode is selected
- //
- if ( $useInteractiveMode ) {
- switch($interactiveShadeMode){
- case "wireframe":
- menuItem -e -radioButton true interactiveShadeWireItem;
- break;
- case "points":
- menuItem -e -radioButton true interactiveShadePointsItem;
- break;
- case "boundingBox":
- menuItem -e -radioButton true interactiveShadeBBoxItem;
- break;
- }
- } else {
- menuItem -e -radioButton true useInteractiveItem;
- }
-
- string $pcamera = `modelPanel -q -camera $ed`;
- int $isOrtho = `getAttr ($pcamera+".orthographic")`;
- menuItem -e -enable false -checkBox $fogging dispFogItem;
- menuItem -e -enable false dispFogOptionItem;
-
- if ( $modeIsShaded ) {
- // Xray is valid in shaded mode, but color index is not
- //
- menuItem -e -en true xrayItem;
- menuItem -e -en true transpSortItem;
- menuItem -e -en true backFaceCullingItem;
- menuItem -e -en true dispTexItem;
- menuItem -e -en true dispTexOptionItem;
-
- if ($isOrtho == 0) {
- menuItem -e -en true dispFogItem;
- menuItem -e -en true dispFogOptionItem;
- }
- if (`menuItem -exists colorIndexItem`) menuItem -e -en false colorIndexItem;
- } else {
- menuItem -e -en false xrayItem;
- menuItem -e -en false transpSortItem;
- menuItem -e -en false backFaceCullingItem;
- menuItem -e -en false dispTexItem;
- menuItem -e -en false dispTexOptionItem;
- if (`menuItem -exists colorIndexItem`) menuItem -e -en true colorIndexItem;
- }
- }
-
-
- global proc updateLightingMenu( string $menu, string $ed )
- //
- // This updates the lighting menu, based on the current settings
- // of the model editor
- //
- {
- global int $supportHWshadows;
-
- setParent -m $menu;
- string $lightingMode = `modelEditor -q -displayLights $ed`;
- int $twoSidedLighting = `modelEditor -q -twoSidedLighting $ed`;
- int $shadows = `modelEditor -q -shadows $ed`;
-
- menuItem -e -checkBox $twoSidedLighting lightTwoSidedItem;
-
- menuItem -e -enable false lightPreviousItem;
-
- string $pcamera = `modelPanel -q -camera $ed`;
- int $isOrtho = `getAttr ($pcamera+".orthographic")`;
-
- // When the menuItem was in a disabled state, but is enabled through
- // a script during a file loading, the menuItem can not be disabled.
- // Hence, by setting it to be enabled before disabling it will
- // synch the state of the menuItem properly.
- //
- menuItem -e -enable true lightHardwareShadows;
- menuItem -e -enable false -checkBox $shadows lightHardwareShadows;
-
- switch($lightingMode){
- case "selected":
- menuItem -e -enable true -radioButton true lightPreviousItem;
- if ($isOrtho == 0)
- menuItem -e -enable $supportHWshadows lightHardwareShadows;
- break;
- case "active":
- menuItem -e -radioButton true lightActiveItem;
- if ($isOrtho == 0)
- menuItem -e -enable $supportHWshadows lightHardwareShadows;
- break;
- case "all":
- menuItem -e -radioButton true lightAllItem;
- if ($isOrtho == 0)
- menuItem -e -enable $supportHWshadows lightHardwareShadows;
- break;
- case "none":
- menuItem -e -enable true lightNoneItem;
- break;
- case "default":
- menuItem -e -radioButton true lightDefaultItem;
- break;
- }
- }
-
- global proc updateShowMenu( string $menu, string $ed )
- //
- // This updates the shading menu, based on the current settings
- // of the model editor
- //
- {
- setParent -m $menu;
-
- menuItem -e -checkBox `modelEditor -q -nurbsCurves $ed` showNurbsCurvesItem;
- menuItem -e -checkBox `modelEditor -q -nurbsSurfaces $ed` showNurbsSurfacesItem;
- menuItem -e -checkBox `modelEditor -q -polymeshes $ed` showPolymeshesItem;
- menuItem -e -checkBox `modelEditor -q -subdivSurfaces $ed` showSubdivSurfacesItem;
- menuItem -e -checkBox `modelEditor -q -planes $ed` showPlanesItem;
- menuItem -e -checkBox `modelEditor -q -cameras $ed` showCamerasItem;
- menuItem -e -checkBox `modelEditor -q -lights $ed` showLightsItem;
- menuItem -e -checkBox `modelEditor -q -joints $ed` showJointsItem;
- menuItem -e -checkBox `modelEditor -q -ikHandles $ed` showIkHandlesItem;
- menuItem -e -checkBox `modelEditor -q -pivots $ed` showPivotsItem;
- menuItem -e -checkBox `modelEditor -q -handles $ed` showHandlesItem;
- menuItem -e -checkBox `modelEditor -q -deformers $ed` showDeformersItem;
- menuItem -e -checkBox `modelEditor -q -dynamics $ed` showDynamicsItem;
- if( fluidEditLicenseFound() ) {
- menuItem -e -checkBox `modelEditor -q -fluids $ed` showFluidsItem;
- }
- menuItem -e -checkBox `modelEditor -q -locators $ed` showLocatorsItem;
- menuItem -e -checkBox `modelEditor -q -dimensions $ed` showDimensionsItem;
- menuItem -e -checkBox `modelEditor -q -textures $ed` showTexturesItem;
- if (`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- menuItem -e -checkBox `modelEditor -q -strokes $ed` showStrokesItem;
- }
-
- menuItem -e -checkBox `modelEditor -q -cv $ed` showNurbsCVsItem;
- menuItem -e -checkBox `modelEditor -q -hulls $ed` showNurbsHullsItem;
- menuItem -edit
- -enable `grid -query -toggle`
- -checkBox `modelEditor -q -grid $ed` showGridItem;
- }
-
- global proc isoSelectAutoAddNewObjs(string $panel, int $state)
- {
- global int $autoAddNewObjJobNum = -1;
-
- if ($state)
- {
- if (!`scriptJob -ex $autoAddNewObjJobNum`)
- {
- $autoAddNewObjJobNum = `scriptJob -protected
- -event "DagObjectCreated" ("isolateSelect -addSelected " + $panel)`;
- }
- }
- else
- {
- scriptJob -force -kill $autoAddNewObjJobNum;
- }
- }
-